var rule = {
    title: '华数TV',
    host: 'https://www.wasu.cn',
    url: '',
    headers: {'User-Agent': MOBILE_UA},
    searchUrl: '/',
    searchable: 2,
    quickSearch: 0,
    class_name: '电影&电视剧&少儿&综艺&FUN假&精选',
    class_url: '961&962&963&965',
    lazy: $js.toString(() => {
        try {
            let api = "" + input.split("?")[0];
            console.log(api);
            let response = fetch(api, {
                method: 'get',
                headers: {
                    'User-Agent': 'okhttp/3.14.9',
                    'Content-Type': 'application/x-www-form-urlencoded'
                }
            });
            let bata = JSON.parse(response);
            if (bata.url.includes("wasu")) {
                input = {
                    parse: 0,
                    url: bata.url,
                    jx: 0,
                    danmaku: "https://danmu.zxz.ee/?type=xml&id=" + input.split("?")[0]
                };
            } else {
                input = {
                    parse: 0,
                    url: input.split("?")[0],
                    jx: 1,
                    danmaku: "https://danmu.zxz.ee/?type=xml&id=" + input.split("?")[0]
                };
            }
        } catch {
            input = {
                parse: 0,
                url: input.split("?")[0],
                jx: 1,
                danmaku: "https://danmu.zxz.ee/?type=xml&id=" + input.split("?")[0]
            };
        }
    }),
    推荐: $js.toString(() => {
        let khtml = fetch('https://mcspapp.5g.wasu.tv/bvradio_app/hzhs/recommendServlet?functionName=getRecommond&modeId=1033&page=1&pageSize=10&siteId=1000101', {headers: rule.headers});
        let kjson = JSON.parse(khtml);
        VODS = [];
        let x = [1, 3, 5, 7];
        x.forEach(q => {
            kjson.data[q].childModels[0].manualList.forEach(it => {
                VODS.push({
                    vod_name: it.title,
                    vod_pic: it.pPic,
                    vod_remarks: it.episodeDesc,
                    vod_id: 'http?'+it.id
                })
            })
        })
    }),
    一级: $js.toString(() => {
    let cid = MY_CATE || '961';
    let pg = MY_PAGE || 1;
    let url = `https://ups.5g.wasu.tv/rmp-user-suggest/1000101/hzhs/searchServlet?functionName=getNewsSearchedByCondition&nodeId=${cid}&nodeTag=%E5%85%A8%E9%83%A8&yearTag=%E5%85%A8%E9%83%A8&countryTag=%E5%85%A8%E9%83%A8&orderType=0&pageSize=40&page=${pg}&keyword=&siteId=1000101`;
    let khtml = fetch(url, {headers: rule.headers});
    let kjson = JSON.parse(khtml);
    VODS = [];
    kjson.data.forEach(it => {
        VODS.push({
            vod_name: it.title,
            vod_pic: it.pPic,
            vod_remarks: it.episodeDesc,
            vod_id: `http?${cid},${it.newsId}`
        });
    });
}),
    二级: $js.toString(() => {
    let [cid, id] = input.split('?')[1].split(',');
    let url = `https://mcspapp.5g.wasu.tv/bvradio_app/hzhs/newsServlet?siteId=1000101&functionName=getCurrentNews&nodeId=${cid}&newsId=${id}&platform=web`;
    let khtml = fetch(url);
    let kjson = JSON.parse(khtml);
    let playList = kjson.data.vodList.map(it => 
            it.title + '$' + `${HOST}/teleplay-detail/${cid}/${id}/${it.vodId}`
        ).join('#');
    VOD = {
        vod_id: `${cid},${id}`,
        vod_name: kjson.data.title,
        vod_pic: kjson.data.pPic,
        type_name: kjson.data.tags,
        vod_remarks: "更新时间" + kjson.data.pubTime + ' ' + kjson.data.episodeDesc,
        vod_year: kjson.data.pubTime.split('-')[0],
        vod_area: kjson.data.countryTag,
        vod_actor: kjson.data.actor,
        vod_director: kjson.data.director,
        vod_content: kjson.data.newsAbstract,
        vod_play_from: '华数TV',
        vod_play_url: playList
    }
}),
搜索:$js.toString(() => {
    let url = `https://ups.5g.wasu.tv/rmp-user-suggest/1000101/hzhs/searchServlet?functionName=getServiceAndNewsSearch&keyword=${KEY}&pageSize=10&page=${MY_PAGE}&siteId=1000101`;
    let khtml = fetch(url);
    let kjson = JSON.parse(khtml);
    VODS = [];
    kjson.data.videoDataList.forEach(it => {
        VODS.push({
            vod_name: it.title,
            vod_pic: it.pPic,
            vod_remarks: it.episodeDesc,
            vod_id: `http?${it.nodeId},${it.newsId}`
        })
    })
})
}